{template /common/user_header}
    <!-- S header -->
    <header>
        <a href="/index.php?m=user&c=index&a=index" class="headerL iconfont">&#xe66a;</a>
        <h1>矿机列表</h1>
    </header>
    <!-- E header -->
    <!-- S 矿机列表 -->
    <ul class="ykj_ty_items" style="margin-bottom:60px;">
        <?php 
            foreach ($lists as $key => $value) {
        ?>
        <li class="ykj_item">
            <div class="flex flex-pack-justify title">
                <div>编号&nbsp;<?php echo $value['order_sn']?></div>
                <div>
                    <?php if($value['status']==1) echo "运行中"?>
                    <?php if($value['status']==2) echo "已停止"?>
                </div>
            </div>
            <div class="ykj_operation flex flex-pack-justify">
                <dl>
                    <dt><img src="{THEME_PATH}images/ykj<?php echo $value['type']?>.png" alt="" width="90" class="ykj_img"></dt>
                    <dd class="ykj_name">{$value['name']}</dd>
                </dl>
                <div class="con">
                    <ul>
                        <li>开 采  率：{$value['rate']}</li>
                        <li>累计拾取：{$value['amount']}<font size="-3"> DBT</font></li>
                    </ul>
                    <?php if($value['buy_type']==1){?>
                    <p>清空时间：{date('Y-m-d H:i:s',$value['clear_time'])}</p>
                    <p>赠送时间：{date('Y-m-d H:i:s',$value['timea'])}</p>
                    <?php }else{?>
                    <p>购买时间：{date('Y-m-d H:i:s',$value['timea'])}</p>
                    <?php }?>
                    <p>到期时间：{date('Y-m-d H:i:s',$value['timeb'])}</p>
                </div>
            </div>
        </li>
        <?php 
            }
        ?>
        <!-- <li class="ykj_item">
            <div class="flex flex-pack-justify title">
                <div>编号&nbsp;4801096</div>
                <div>运行中</div>
            </div>
            <div class="ykj_operation flex flex-pack-justify">
                <dl>
                    <dt><img src="{THEME_PATH}images/ty.png" alt="" width="90" class="ykj_img"></dt>
                    <dd class="ykj_name">体验云矿机</dd>
                </dl>
                <div class="con">
                    <ul>
                        <li>开 采  率：0.01kb/s~0.011kb/s</li>
                        <li>累计拾取：3.02896512DBT</li>
                    </ul>
                    <p>清空时间：2018-07-27 18:27:51</p>
                    <p>赠送时间：2018-07-27 18:27:51</p>
                    <p>到期时间：2018-07-27 18:27:51</p>
                </div>
            </div>
            <p class="tips">注：最迟每3天拾取一次，如超时未拾取，第4天将清空前3天累计开采的DBT</p>
            <a href="" class="pickup_btn">一键拾取</a>
        </li> -->
        <li class="ykj_item" style="position: fixed;bottom:0px;width:100%;border-top:none">
            <!-- <p class="tips">注：最迟每3天拾取一次，如超时未拾取，第4天将清空前3天累计开采的DBT</p> -->
            <a href="javascript:;" onclick="pickAll();" class="pickup_btn">一键拾取</a>
        </li>
    </ul>
    <!-- E 矿机列表 -->
    <script type="text/javascript">
        function pickAll(){


            layer.open({type: 2});
            $.ajax({
                type:'post',
                url:'/index.php?m=user&c=order&a=picker',
                // data:{id:mid,pinpass:password,order_sn:order_sn},
                dataType:'json',
                success:function(ret){
                  layer.closeAll();
                  console.log(ret);

                  if(ret.status==1){
                      layer.open({
                        content: ret.info
                        ,skin: 'msg'
                        ,time: 2
                        ,end:function(){
                            window.location.reload()
                        }
                      });
                  }else{
                        tips(ret.info);
                  }
                  

                  // layer.open({
                  //   title: ''
                  //   ,className: 'popuo-zbinfo', //这样你就可以在css里面控制该弹层的风格了
                  //   content:html,
                  //   success: function(elem){  
                  //       $('.popuo-zbinfo ').prepend('<div class="popup-close" ></div>');
                  //   }  
                  // })
                }
            })

        }
    </script>
</body>
</html>